package com.it.aop.demoaop01.jdbc.mapper;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @Author: xiaoqiang
 * @Description:
 * @Date: 2021/6/25
 * @Version: 1.0
 */
@Repository
public class UserMapper4 {

    public void addDate(JdbcTemplate jdbcTemplate) throws SQLException {
        Connection connection = jdbcTemplate.getDataSource().getConnection();
        StringBuilder sql=new StringBuilder(" insert into user(name) value(?)");
        jdbcTemplate.update(sql.toString(),new Object[]{"猪八戒"});
    }
}
